package com.zhanbo.zhanbowymusic.play;

import android.content.Context;
import android.text.TextUtils;

import androidx.databinding.ObservableArrayList;

import com.mwx.baselib.base.BaseBindingAdapter;
import com.mwx.baselib.bean.SongBean;
import com.mwx.baselib.utils.DateUtils;
import com.mwx.baselib.utils.GlideUtils;
import com.zhanbo.zhanbowymusic.R;
import com.zhanbo.zhanbowymusic.databinding.ItemPlayListBinding;
import com.zhanbo.zhanbowymusic.databinding.ItemVipHitBinding;

public class PlayListAdapter extends BaseBindingAdapter<SongBean, ItemPlayListBinding> {
    public PlayListAdapter(Context context) {
        super(context);
    }



    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.item_play_list;
    }
    @Override
    protected void onBindItem(ItemPlayListBinding binding, SongBean item) {
        binding.tvName.setText(TextUtils.isEmpty(item.getName())?"":item.getName());
        binding.tvSingerName.setText(TextUtils.isEmpty(item.getArtistName())?"":item.getArtistName());
        GlideUtils.loadImageRounded10(context,item.getCoverImg(),binding.ivHead);
        binding.tvNum.setText((++position)+"");
        binding.tvTime.setText(String.valueOf(item.getDuration()).replace(".",":"));
    }
}
